package com.naiterui.ehp.bs.wechat.param.custom;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

import com.naiterui.ehp.bs.wechat.protocol.msg.custom.CustomMsg;

import lombok.Data;

/**
 * 客服消息参数
 *
 * @author zhoupeipei
 * @date 2019-07-05 14:27
 * @since 1.0.0
 */
@Data
public abstract class BaseCustomParam implements Serializable {
    private static final long serialVersionUID = 8443952370620127655L;
    /**
     * 接收用户
     */
    private String openId;
    /**
     * 消息类型
     */
    private String msgType;

    /**
     * 获取微信客服消息通讯协议结构数据
     *
     * @return
     */
    public abstract CustomMsg getCustomProtocol();

    /**
     * 参数信息校验
     * @return
     */
    protected boolean validate() {
        return StringUtils.isNotBlank(openId) && StringUtils.isNotBlank(msgType);
    }
}
